from torchair._ge_concrete_graph.ge_converter.converter_utils import *


@declare_supported([
    Support(F32(3, 4)),
    Support(F16(3, 4)),
])
@register_fx_node_ge_converter(torch.ops.aten.ceil.default)
def conveter_aten_ceil_default(self: Tensor, meta_outputs: TensorSpec = None):
    """NB: aten::ceil(Tensor self) -> Tensor"""
    return dtype_promote(ge.Ceil(self), target_dtype=meta_outputs.dtype)


@register_fx_node_ge_converter(torch.ops.aten.ceil.out)
def conveter_aten_ceil_out(
    self: Tensor, *, out: Tensor = None, meta_outputs: TensorSpec = None
):
    """NB: aten::ceil.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)"""
    raise RuntimeError("torch.ops.aten.ceil.out ge_converter is not supported!")


@register_fx_node_ge_converter(torch.ops.aten.ceil.int)
def conveter_aten_ceil_int(a: int, meta_outputs: TensorSpec = None):
    """NB: aten::ceil.int(int a) -> int"""
    raise RuntimeError("torch.ops.aten.ceil.int ge_converter is not supported!")


@register_fx_node_ge_converter(torch.ops.aten.ceil.float)
def conveter_aten_ceil_float(a: float, meta_outputs: TensorSpec = None):
    """NB: aten::ceil.float(float a) -> int"""
    raise RuntimeError("torch.ops.aten.ceil.float ge_converter is not supported!")


@register_fx_node_ge_converter(torch.ops.aten.ceil.Scalar)
def conveter_aten_ceil_Scalar(a: Union[Number, Tensor], meta_outputs: TensorSpec = None):
    """NB: aten::ceil.Scalar(Scalar a) -> Scalar"""
    raise RuntimeError("torch.ops.aten.ceil.Scalar ge_converter is not supported!")
